package com.wx.web.controller.pay;

import com.alibaba.fastjson2.JSONObject;
import com.wx.api.service.PayService;
import com.wx.api.wxapi.IWxApi;
import com.wx.model.dto.PayParameter;
import com.wx.model.dto.PrePayDto;
import com.wx.model.vo.PrePayVo;
import io.swagger.annotations.Api;
import io.swagger.annotations.ApiOperation;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.PostMapping;
import org.springframework.web.bind.annotation.RequestBody;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

import javax.annotation.Resource;

@Api(value = "小程序支付" ,tags = "支付")
@RestController
@RequestMapping("/wxPay/")
public class WxPayController {

    @Resource
    private PayService payService;

    @ApiOperation("创建预支付订单")
    @PostMapping("/createPrePayOrder")
    public PrePayVo createOrder(@RequestBody PayParameter payParameter) throws Exception {
        payService.createPay(payParameter);
        return null;
    }
}
